home *** CD-ROM | disk | FTP | other *** search
- unit UCvtFrac;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TCvtFraction = class(TForm)
- Label1: TLabel;
- Edit1: TEdit;
- Button1: TButton;
- Label2: TLabel;
- Edit2: TEdit;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- CvtFraction: TCvtFraction;
-
- implementation
-
- uses
- AACvFrac;
-
- {$R *.DFM}
-
- procedure TCvtFraction.Button1Click(Sender: TObject);
- var
- Value : double;
- Numerator : longint;
- Denominator : longint;
- begin
- Value := StrToFloat(Edit1.Text);
- ConvertFraction(Value, Numerator, Denominator);
- Edit2.Text := IntToStr(Numerator) + '/' + IntToStr(Denominator);
- end;
-
- end.
-